package com.cnboy.security.controller;

import com.cnboy.security.domain.ResponseResult;
import com.cnboy.security.domain.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import com.cnboy.security.service.listService;


@RestController
@CrossOrigin
public class ListController {
    @Autowired
    private listService listService;

    @GetMapping("/user/list")
    @PreAuthorize("hasAuthority('admin')")
    public ResponseResult userList(){
        return  listService.userList();
    }
}
